"""工具函数模块"""

def build_query_params(fund_code=None, fund_name=None, **kwargs):
    """构建查询参数"""
    params = {}
    if fund_code:
        params['fund_code'] = fund_code
    if fund_name:
        params['fund_name'] = fund_name
    params.update(kwargs)
    return params

def validate_date(date_str):
    """验证日期格式"""
    # 这里可以添加日期验证逻辑
    return True

def format_percentage(value):
    """格式化百分比显示"""
    if value and isinstance(value, (int, float)):
        return f"{value:.2f}%"
    return value